import {createRouter as _createRouter, createWebHistory} from 'vue-router';
// 导入 凡是想要通过路由跳转的，都需要在这：1.导入  2.注册 设置对应vue组件的路径名
import Index from '../views/Index.vue'
import Add from '../views/Add.vue'
import Update from '../views/Update.vue'
import List from '../views/List.vue'

const routes = [
    // 注册 设置对应vue组件的路径名
    { path: '/', component: Index },
    { path: '/add', component: Add },
    { path: '/update', component: Update },
    { path: '/list', component: List }
]

export function createRouter() {
    return _createRouter({
        history: createWebHistory(),
        routes
    })
}
